package com.huaguoguo.cyg.aspect;

import com.huaguoguo.cyg.controller.model.ResultModel;
import lombok.extern.slf4j.Slf4j;
import org.aspectj.lang.ProceedingJoinPoint;
import org.aspectj.lang.annotation.Around;
import org.aspectj.lang.annotation.Aspect;
import org.springframework.stereotype.Component;

/**
 * 类说明： 前端控制器切面<br/>
 * author:huaguoguo
 * Date: 2020/2/27
 * Time: 9:17
 */
@Aspect
@Slf4j
@Component
public class ControllerAspect {

    @Around("@annotation(com.huaguoguo.cyg.annotation.ResultModelBuilder)")
    public Object builderResultModel(ProceedingJoinPoint point) throws Throwable{
        Object proceed = point.proceed();
        return ResultModel.defaultSuccess(proceed);
    }
}
